Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make actions use target=this implicitly #14479

Closed
wants to merge 3 commits into from

Conversation

zackthehuman
Copy link
Contributor

This addresses the bug in #14469. Might need a new test. Please review @rwjblue @chancancode.

@zackthehuman
Copy link
Contributor Author

I added a test.

<button {{action this 'foo'}}>
<button onblur={{action this 'foo'}}>
<button onblur={{action this (action this 'foo') 'bar'}}>
<button {{action target=this 'foo'}}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't quite right, the hash has to be after positional args...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL...

<button onblur={{action this (action this 'foo') 'bar'}}>
<button {{action target=this 'foo'}}>
<button onblur={{action target=this 'foo'}}>
<button onblur={{action target=this (action target=this 'foo') 'bar'}}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this also backwards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes; it has been corrected.

}

return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is unfortunately repeated. @rwjblue should the util function be DRY somewhere? And if so where?

if (pair.key === key) {
return pair;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is unfortunately repeated. @rwjblue should the util function be DRY somewhere? And if so where?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will extract it and then make another PR to update other refs.

@Serabe
Copy link
Member

Serabe commented Oct 28, 2016

@zackthehuman is this ready for a new review? Thank you!

@zackthehuman
Copy link
Contributor Author

@Serabe I think we may punt on this due to what was discussed in #14469. Closing for now.

@Serabe
Copy link
Member

Serabe commented Oct 31, 2016

@zackthehuman thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants